import axios from "axios";


const myAxios = axios.create({
  baseURL: "http://interview-api-t.itheima.net/",
  timeout: 5000,
});

//设置响应拦截
myAxios.interceptors.response.use(
  (response) => {
    // console.log(response);
    return response.data;
  },
  (error) => {
    const {response} = error;
    if(response){
        console.log(response);
    }
    return Promise.reject(error);
  }
);


export default myAxios;